<template >
  <el-form  label-width="100px" style="height: 400px">
    <div class="box">
      <div title="左" >
        <el-form-item label="中文名称">
          <el-col style="width: 215px">
            <el-input v-model="basicConfig.fileZhName" id="fileZhName" size=small :disabled="disabled" ></el-input>
          </el-col>
        </el-form-item>
        <el-form-item label="英文名称">
          <el-col style="width: 215px">
            <el-input v-model="basicConfig.fileEnName" id="fileEnName" size=small :disabled="disabled"></el-input>
          </el-col>
        </el-form-item>
        <el-form-item label="权限组">
          <el-col style="width: 300px">
            <el-select v-model="basicConfig.roleGroup" size="small" :disabled="disabled">
              <el-option selected disabled value="">请选择</el-option>
              <el-option
                v-for="(item, key) in roleGroup"
                :key="key"
                :value="item.dictValue"
                :label="item.dictLabel"
              />
            </el-select>
          </el-col>
        </el-form-item>
        <el-form-item label="业务类型">
          <el-col style="width: 300px">
            <el-select v-model="basicConfig.bizType" size="small" :disabled="disabled">
              <el-option disabled value="">请选择</el-option>
              <el-option
                v-for="(item, key) in bizType"
                :key="key"
                :value="item.dictValue"
                :label="item.dictLabel"
              />
            </el-select>
          </el-col>
        </el-form-item>
        <el-form-item label="机型">
          <el-col style="width: 300px">
            <el-select v-model="basicConfig.airplaneType" size="small" :disabled="disabled">
              <el-option disabled value="">请选择</el-option>
              <el-option
                v-for="(item, key) in airplaneType"
                :key="key"
                :value="item.dictValue"
                :label="item.dictLabel"
              />
            </el-select>
          </el-col>
        </el-form-item>
        <el-form-item label="配置点类型">
          <el-col style="width: 300px">
            <el-select v-model="basicConfig.configType" size="small" :disabled="disabled">
              <el-option disabled value="">请选择</el-option>
              <el-option
                v-for="(item, key) in configType"
                :key="key"
                :value="item.dictValue"
                :label="item.dictLabel"
              />
            </el-select>
          </el-col>
        </el-form-item>
      </div>
      <div title="右" >

        <el-form-item label="备注">
          <el-col style="width: 220px">
            <el-input v-model="basicConfig.remark" style=" " type ="textarea" id="remark" size="big" :disabled="disabled"></el-input>
          </el-col>
        </el-form-item>
        <el-form-item label="创建人">
          <el-col style="width: 220px">
            <el-input v-model="basicConfig.createdBy" id="createdBy" size=small :disabled="disabled"></el-input>
          </el-col>
        </el-form-item>
        <el-form-item label="创建时间">
          <el-col style="width: 300px">
            <el-date-picker v-model="basicConfig.createdTime"
                            format="yyyy-MM-dd HH:mm:ss"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            clearable type="datetime" size="small" :disabled="disabled">
            </el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="最新修改人">
          <el-col style="width: 220px">
            <el-input v-model="basicConfig.updatedBy" id="updatedBy" size=small :disabled="disabled"></el-input>
          </el-col>
        </el-form-item>
        <el-form-item label="最新修改时间">
          <el-col style="width: 300px">
             <el-date-picker  v-model="basicConfig.updatedTime"
                              format="yyyy-MM-dd HH:mm:ss"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              clearable  type="datetime" size=small :disabled="disabled">
             </el-date-picker>
          </el-col>
        </el-form-item>

      </div>
    </div>
<!--    <div style="float: left; width: 100%; text-align: center; margin-top: 15px">-->
<!--      <el-button  type="primary" @click="submit">提交</el-button>-->
<!--    </div>-->
  </el-form>

</template>
<script>
import { dictChildDetail } from '@/api/dict/dict'
export default {
  props: {
    disabled: Boolean,
    configId: '',
    basicConfig: {
      configId: '',
      bizType: '',
      airplaneType: '',
      configType: '',
      fileZhName: '',
      fileEnName: '',
      roleGroup: '',
      remark: '',
      createdBy: '',
      createdTime: '',
      updatedBy: '',
      updatedTime: '',
      fileUrl: '',
      content: ''
    }
  },
  data () {
    return {
      // 业务类型
      bizType: [],
      // 机型
      airplaneType: [],
      //  配置点
      configType: [],
      roleGroup: []
    }
  },
  created () {
    this.basicConfigData()
  },
  methods: {
    basicConfigData () {
      // // 获取基本配置信息
      // const id = this.configId
      // if (id !== '0') {
      //   this.configDetailParams.configId = this.configId
      //   configDetail(this.configDetailParams).then(res => {
      //     if (res.code === 0) {
      //       this.basicConfig = res.data
      //     }
      //   })
      // } else {
      //
      // }
      // 业务类型
      const bizType = 'bizType'
      dictChildDetail(bizType).then((res) => {
        this.bizType = this.handleDict(res.data)
      })

      // 机型
      const airplaneType = 'airplaneType'
      dictChildDetail(airplaneType).then((res) => {
        this.airplaneType = this.handleDict(res.data)
      })
      // 配置点
      const configType = 'configType'
      dictChildDetail(configType).then((res) => {
        this.configType = this.handleDict(res.data)
      })
      // 权限组
      const roleGroup = 'roleGroup'
      dictChildDetail(roleGroup).then((res) => {
        this.roleGroup = this.handleDict(res.data)
      })
    }
  }
}
</script>
<style lang='postcss'>
.box {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: row;
  min-height: 400px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
}
.box > div {
  height: 22px;
  flex: 1;
}

</style>
